<template>
  <headPage></headPage>
  <div class="main_box information">
    <titleBack title="积分明细"></titleBack>
    <div class="detail_title">
      <div class="title_left"></div>
      <div class="title_right">
        <div class="right_date">
          <el-date-picker
            v-model="date"
            :clearable="false"
            type="daterange"
            size="small"
            format="YYYY/MM/DD"
            value-format="YYYY-MM-DD"
            @change="dateChange"
            range-separator=" - "
            start-placeholder="开始时间"
            end-placeholder="结束时间"
          />
          <img src="../../../assets/my/16.png" alt="" />
        </div>
      </div>
    </div>
    <div class="tab_content" v-loading="loading">
      <div class="table_th">
        <div class="th_item th_w_1">时间</div>
        <div class="th_item th_w_1">积分</div>
        <div class="th_item th_w_1">积分总额</div>
        <div class="th_item th_w_1">描述</div>
      </div>
      <div class="table_td" v-for="(item, index) in pointList" :key="index">
        <div class="td_item th_w_1">{{ item.create_time }}</div>
        <div class="td_item th_w_1">{{ item.biandongshuliang }}</div>
        <div class="td_item th_w_1">{{ item.biandonghoushuliang }}</div>
        <div class="td_item th_w_1">{{ item.laiyuan_name }}</div>
      </div>
    </div>
    <div class="no_data" v-if="pointList.length == 0 && !loading">
      <img class="no_img" src="../../../assets/default/12.png" alt="" />
    </div>
    <paging
        :total="total"
        :pageSize="pageSize"
        @pageChange="pageChange"
      ></paging>
  </div>
  <footerPage></footerPage>
</template>
  
  
  <script name="pointsDetails" setup>
import { post66222456b35cf } from "@/utils/api.js";
import headPage from "@/components/headPage.vue";
import footerPage from "@/components/footerPage.vue";
import paging from "@/components/paging.vue";
import titleBack from "../titleBack.vue";

import { ref, reactive, onMounted } from "vue";
import { useRouter } from "vue-router";
let router = useRouter();


onMounted(() => {
  getList();
});

let date = ref("");
let select_time = ref("");
function dateChange(e) {
  select_time.value = e[0] + '/' + e[1];
  loading.value = true;
  getList();
}

let pointList = ref([]);
let total = ref(0);
let loading = ref(true);
let pageNum = ref(1);
let pageSize = ref(10);
function getList() {
  post66222456b35cf({
    create_time: select_time.value,
    page: pageNum.value,
    list_rows: pageSize.value,
  }).then((res) => {
    // console.log(res);
    loading.value = false;
    if (res.code == 1) {
      total.value = res.data.total;
      pointList.value = res.data.data;
    }
  });
}
// 分页
function pageChange(page) {
  pageNum.value = page;
  loading.value = true;
  getList();
}
</script>
  
<style lang="scss" scoped>
.information {
  margin-top: 110px;
  margin-bottom: 24px;
  padding: 18px 16px;
  background: #fff;
  min-height: 358px;

  .title_info {
    display: flex;
    align-items: center;
    .info_1 {
      width: 10px;
      height: 10px;
      cursor: pointer;
    }
    .info_2 {
      font-size: 10px;
      font-weight: 500;
      margin-left: 6px;
    }
    .info_3 {
      width: 8px;
      height: 8px;
      margin-left: 6px;
      cursor: pointer;
    }
  }
  .tips {
    padding: 9px 12px;
    font-size: 7px;
    color: #666666;
    margin-top: 13px;
    background: #f6f7f9;
    border-radius: 3px;
  }
  .tixian_title {
    margin: 18px 0 12px;
    font-size: 9px;
  }
  .tixian_input {
    width: 260px;
    height: 28px;
    background: #f6f7f9;
    border-radius: 3px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    .tixian_input_1 {
      font-size: 10px;
      font-weight: bold;
    }
    .tixian_input_2 {
      font-size: 7px;
      flex: 1;
    }
    .tixian_input_3 {
      color: #1f52ae;
      font-size: 8px;
      cursor: pointer;
    }
  }
  .tixian_fees {
    font-size: 7px;
    color: #999;
    margin-top: 10px;
  }
  .types {
    display: flex;
    align-items: center;
    .types_item {
      display: flex;
      align-items: center;
      font-size: 8px;
      background: url(../../../assets/my/21.png) no-repeat;
      background-size: 100% 100%;
      width: 130px;
      height: 36px;
      margin-right: 8.5px;
      padding-left: 16px;
      border-radius: 3px;
      cursor: pointer;
      &.active {
        border: 1px solid #1f52ae;
      }
      img {
        width: 18px;
        height: 18px;
        margin-right: 6px;
      }
    }
  }
  .save_btn {
    width: 100px;
    height: 24px;
    background: #1f52ae;
    font-size: 8px;
    color: #fff;
    border-radius: 3px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .line {
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: #f6f7f9;
  }
  .detail_title {
    margin: 19.5px 0 15.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .title_left {
      font-size: 9px;
      font-weight: 500;
    }
    .title_right {
      display: flex;
      justify-content: flex-end;
      .right_date {
        font-size: 8px !important;
        border-radius: 2px;
        border: 1px solid #e5e5e5;
        height: 16px;
        width: 130px;
        position: relative;
        img {
          width: 7px;
          height: 7px;
          position: absolute;
          right: 8px;
          top: 50%;
          transform: translateY(-50%);
        }
      }
      .wallet_tab {
        display: flex;
        align-items: center;
        margin-left: 10px;
        .tab_item {
          width: 36px;
          height: 16px;
          background: #f6f7f9;
          border-radius: 8px;
          display: flex;
          align-items: center;
          justify-content: center;
          font-size: 8px;
          color: #666666;
          margin-left: 10px;
          cursor: pointer;
          &.active {
            background: #e8edf7;
            color: #1f52ae;
            font-weight: 500;
          }
        }
      }
    }
  }
  .tab_content {
    width: 688px;
    margin: 15.5px 0 8px 0;
    .table_th {
      background: #f6f7f9;
      border-top: 1px solid #eeeeee;
      border-left: 1px solid #eeeeee;
      border-bottom: 1px solid #eeeeee;
      display: flex;
      .th_item {
        padding: 8.5px 12px;
        // padding: 0 12px;
        border-right: 1px solid #eeeeee;
        font-size: 7px;
        color: #666;
      }
    }
    .table_td {
      border-left: 1px solid #eeeeee;
      border-bottom: 1px solid #eeeeee;
      display: flex;
      .td_item {
        padding: 8.5px 12px;
        border-right: 1px solid #eeeeee;
        font-size: 7px;
        display: flex;
        align-items: center;
      }
    }
    .th_w_1 {
      width: 172px;
    }
    .table_td:hover {
      background: #f6f7f9;
    }
  }
}
.modal_content {
  background: #fff;
  width: 268px;
  padding-bottom: 16px;
  .tip_title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    font-weight: bold;
    height: 28px;
    background: #1f52ae;
    padding: 0 12px 0 16px;
    color: #fff;
    img {
      width: 8px;
      height: 8px;
      cursor: pointer;
    }
  }
  .tip_text {
    font-size: 8px;
    margin: 42px 0 0px;
    color: #666666;
    text-align: center;
  }
  .psd_value {
    display: flex;
    justify-content: center;
    margin: 17.5px 0 36px;
  }
  .modal_success {
    text-align: center;
    padding-top: 35px;
    img {
      width: 40px;
      height: 40px;
    }
    .success_text_1 {
      text-align: center;
      margin: 13px 0 12px;
      font-size: 10px;
      font-weight: 500;
    }
    .success_text_2 {
      margin: 0 64px 28px;
      font-size: 8px;
      color: #666;
      text-align: center;
    }
  }
  .tip_btn {
    display: flex;
    align-items: center;
    justify-content: center;

    .tip_btn_1 {
      width: 100px;
      height: 24px;
      background: #f6f7f9;
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 8px;
      cursor: pointer;
    }
    .tip_btn_2 {
      width: 100px;
      height: 24px;
      background: #1f52ae;
      color: #fff;
      border-radius: 3px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 8px;
      cursor: pointer;
    }
  }
}
</style>